import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "@/store";

Vue.config.productionTip = false;

//导入axios对象，配置Vue原型
import axios from "./utils/request";
Vue.prototype.$axios = axios;

// 配置vant-ui
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);


// 挂载路由守卫
// router.beforeEach((to, from, next) => {
//   if (to.path == "/login") {
//     if (store.state.token != "") {
//       next("/index");
//     }
//   } else {
//     if (store.state.token == "") {
//       next("/login");
//     }
//   }
//   if(to.meta.hasOwnProperty("baner")){
//     document.title = to.meta.baner
//   }
//   next();
// });

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
